package com.logic.landseaserver.ws.request;

import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;

import com.logic.landseaserver.domain.Contract;
import com.logic.landseaserver.ws.dto.UrgentDTO;

import io.swagger.annotations.ApiModelProperty;

/**
 * Created by Administrator on 2017/5/22.
 */
public class UpdateOffLineContractsReq {
    @ApiModelProperty(value = "合同", position = 1)
    private Integer contractId;

    @ApiModelProperty(value = "项目ID", position = 1)
    private Integer projectId;

    @ApiModelProperty(value = "用户ID", position = 1)
    private Integer userId;

    @ApiModelProperty(value = "手机", position = 1)
    private String cellPhone;
    @ApiModelProperty(value = "姓名", position = 1)
    private String certificatesName;

    @ApiModelProperty(value = "证件ID", position = 1)
    private String certificatesId;

    @ApiModelProperty(value = "地址", position = 1)
    @NotEmpty
    private String certificatesAddress;

    @ApiModelProperty(value = "证件类型", position = 1)
    @NotEmpty
    private String certificatesType;

    @ApiModelProperty(value = "房间ID", position = 1)
    @NotEmpty
    private Integer roomId;
    @ApiModelProperty(value = "来源", position = 1)
    @NotEmpty
    private String source;
    @ApiModelProperty(value = "备注", position = 1)
    @NotEmpty
    private String remark;
    @ApiModelProperty(value = "付租方式", position = 1)
    private String paymentMode;
    @ApiModelProperty(value = "租期", position = 1)
    private String lease;
    @ApiModelProperty(value = "开始日期", position = 1)
    private Date inDate;
    @ApiModelProperty(value = "结束日期", position = 1)
    private Date outDate;
    @ApiModelProperty(value = "紧急联系人", position = 1)
    private UrgentDTO urgentDTO;

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCertificatesName() {
        return certificatesName;
    }

    public void setCertificatesName(String certificatesName) {
        this.certificatesName = certificatesName;
    }

    public String getCertificatesId() {
        return certificatesId;
    }

    public void setCertificatesId(String certificatesId) {
        this.certificatesId = certificatesId;
    }

    public String getCellPhone() {
        return cellPhone;
    }

    public void setCellPhone(String cellPhone) {
        this.cellPhone = cellPhone;
    }

    public String getPaymentMode() {
        return paymentMode;
    }

    public void setPaymentMode(String paymentMode) {
        this.paymentMode = paymentMode;
    }

    public String getLease() {
        return lease;
    }

    public void setLease(String lease) {
        this.lease = lease;
    }

    public Date getInDate() {
        return inDate;
    }

    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }

    public Date getOutDate() {
        return outDate;
    }

    public void setOutDate(Date outDate) {
        this.outDate = outDate;
    }

    public String getCertificatesAddress() {
        return certificatesAddress;
    }

    public void setCertificatesAddress(String certificatesAddress) {
        this.certificatesAddress = certificatesAddress;
    }

    public Integer getContractId() {
        return contractId;
    }

    public void setContractId(Integer contractId) {
        this.contractId = contractId;
    }

    public String getCertificatesType() {
        return certificatesType;
    }

    public void setCertificatesType(String certificatesType) {
        this.certificatesType = certificatesType;
    }

    public Integer getRoomId() {
        return roomId;
    }

    public void setRoomId(Integer roomId) {
        this.roomId = roomId;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public UrgentDTO getUrgentDTO() {
        return urgentDTO;
    }

    public void setUrgentDTO(UrgentDTO urgentDTO) {
        this.urgentDTO = urgentDTO;
    }

    public static Contract convertDTOtoContract(CreateOffLineContractsReq req) {
        Contract contract = new Contract();
        contract.setId(req.getContractId());
      /*  contract.setCertificatesType(req.getCertificatesType());
        contract.setCertificatesId(req.getCertificatesId());
        contract.setCertificatesAddress(req.getCertificatesAddress());
        contract.setCertificatesName(req.getCertificatesName());
        contract.setGender(req.getGender());*/
        contract.setProjectId(req.getProjectId());
        contract.setRoomId(req.getRoomId());
        contract.setPaymentMode(req.getPaymentMode());
        contract.setLease(req.getLease());
        contract.setInDate(req.getInDate());
        contract.setOutDate(req.getOutDate());
        contract.setUserId(req.getUserId());
        contract.setRemark(req.getRemark());
        contract.setSource(req.getSource());
        contract.setLeaseM(req.getLeaseM());
        contract.setLeaseD(req.getLeaseD());
        contract.setPayM(req.getPayM());
        contract.setDepositM(req.getDepositM());
        return contract;
    }
}
